/*
 *  mini-SaaS
 *  Application for developing Software as a Service (SaaS) 
 *  Copyright (c) 2011 Anand Sudhakaran, Bryce Holton, Chao Zhang
 *  ASU
 *
 *  This file is part of mini-SaaS.
 *
 *  mini-SaaS is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  mini-SaaS is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.

 *  You should have received a copy of the GNU General Public License
 *  along with mini-SaaS; if not, see <http://www.gnu.org/licenses/>. 
 *
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package loginbean;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

public class OntologyManager {
   public static ArrayList<Integer> getNextService(int serviceID){
       ArrayList<Integer> nextIDs = new ArrayList<Integer>();
       Connection conn = null;
		DBManager db = new DBManager();
		String strQuery = ""; 
		Statement st = null;
		ResultSet rs = null;
		//System.out.println("here");
		try 
		{
			conn = db.getDatabaseConnection();
			strQuery = "Select NextWSID from OntologyTable where WSID = " + serviceID;
			st = conn.createStatement();
			rs = st.executeQuery(strQuery);
                        while(rs.next())
			{
                            nextIDs.add(rs.getInt(1));
                        
                        }
                      conn.close();  
                }
                catch (Exception e) 
		{
			e.printStackTrace();
		}
       
       return nextIDs;
   }
          
    
}
